/*    */ package com.newcrm.util;
/*    */ 
/*    */ import com.newcrm.bean.CompanyInfo;
/*    */ import com.newcrm.bean.QisoukeActivationCode;
/*    */ import com.newcrm.bean.User;
/*    */ import java.io.PrintStream;
/*    */ import java.net.URLEncoder;
/*    */ import java.util.Date;
/*    */ import org.jsoup.Connection;
/*    */ import org.jsoup.Jsoup;
/*    */ import org.jsoup.nodes.Document;
/*    */ 
/*    */ public class JsoupManager
/*    */ {
/*    */   public static Document getSearchResult(User user, CompanyInfo company, String searchUrl)
/*    */     throws Exception
/*    */   {
/* 32 */     String serialId = company.qisoukeActivationCode.sn;
/* 33 */     String usersList = company.qisoukeActivationCode.authUsers;
/* 34 */     String companyName = company.name;
/* 35 */     String createDate = Util.date2Str(company.createDate);
/*    */ 
/* 37 */     String date = Util.date2Str(new Date());
/*    */ 
/* 39 */     String spam = MD5.getMD5(serialId + MD5.getMD5(date) + 
/* 40 */       "kkddkdddkj0");
/*    */ 
/* 42 */     return Jsoup.connect(searchUrl.toString())
/* 43 */       .header("companyName", URLEncoder.encode(companyName, "UTF-8"))
/* 44 */       .header("serialId", serialId).header("createDate", createDate)
/* 45 */       .header("usersList", usersList)
/* 46 */       .header("userId", user.getUserId()).header("searchDate", date)
/* 47 */       .header("spam", spam).timeout(30000).get();
/*    */   }
/*    */ 
/*    */   public static void main(String[] args)
/*    */     throws Exception
/*    */   {
/* 57 */     String key = "1";
/*    */ 
/* 59 */     User user = new User();
/* 60 */     user.userId = "admin";
/*    */ 
/* 62 */     CompanyInfo company = new CompanyInfo();
/* 63 */     QisoukeActivationCode qisoukeActivationCode = new QisoukeActivationCode();
/* 64 */     qisoukeActivationCode.sn = "05AJ-WQU0-AN5S-BUIW-XWWS-4T97-XKOM-QSK";
/* 65 */     qisoukeActivationCode.authUsers = "admin";
/* 66 */     company.name = "北京博众致远网络科技有限公司曾超测试机";
/* 67 */     company.createDate = Util.str2Date2("2016-8-5 14:09:13");
/*    */ 
/* 69 */     company.qisoukeActivationCode = qisoukeActivationCode;
/*    */ 
/* 71 */     StringBuffer searchUrl = new StringBuffer();
/* 72 */     String url = "http://localhost:8080/HuangyeWeb/qisouke";
/*    */ 
/* 74 */     url = "http://so.qikebao.com/qisouke";
/*    */ 
/* 77 */     searchUrl.append(url + "?k=").append(URLEncoder.encode(key, "UTF-8"))
/* 78 */       .append("&page=1");
/*    */ 
/* 80 */     Document doc = getSearchResult(user, company, 
/* 81 */       searchUrl.toString());
/* 82 */     System.out.println(doc.text());
/* 83 */     System.out.println("end");
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.util.JsoupManager
 * JD-Core Version:    0.6.1
 */